#! /bin/bash
# Copyright Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
# 启动脚本配置文件，可配置GPU、CPU等

#是否使能硬件解码功能, 1表示使能，其他值默认不使能
ENABLE_HARD_DECODE=0

#是否使能渲染中间层，1表示使能，其他值默认不使能
ENABLE_RENDER_LAYER=0

#是否使能软渲染，1表示使能，其他值默认不使能
ENABLE_SOFT_RENDER=0

#是否使能纯64位，1表示使能，其他值默认不使能
ENABLE_ONLY64_KBOX=0

#硬件解码卡类型：0：T432 1：Quadra
HARD_DECODE_TYPE=2

# NETINT编解码卡设备节点, 启用硬解或者重启时启用硬解都需在第一次启动时增加设备节点，以下为示意
# NETINT0="/dev/nvme0,/dev/nvme0n1,/dev/nvme1,/dev/nvme1n1,/dev/nvme2,/dev/nvme2n1,/dev/nvme3,/dev/nvme3n1"
# NETINT1="/dev/nvme4,/dev/nvme4n1,/dev/nvme5,/dev/nvme5n1,/dev/nvme6,/dev/nvme6n1,/dev/nvme7,/dev/nvme7n1"
NETINT0=""
NETINT1=""

KBOX_DEC_MAP=(
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT0}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
    "${NETINT1}"
)

KBOX_GPU_MAP=(
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
/dev/dri/renderD129
)

KBOX_XD_GPU_MAP_4RENDERS=(
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
)

KBOX_XD_GPU_MAP_8RENDERS=(
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
)

KBOX_XD_GPU_MAP_16RENDERS=(
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
)

KBOX_XD_GPU_MAP_24RENDERS=(
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD144
/dev/dri/renderD145
/dev/dri/renderD146
/dev/dri/renderD147
/dev/dri/renderD148
/dev/dri/renderD149
/dev/dri/renderD150
/dev/dri/renderD151
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD144
/dev/dri/renderD145
/dev/dri/renderD146
/dev/dri/renderD147
/dev/dri/renderD148
/dev/dri/renderD149
/dev/dri/renderD150
/dev/dri/renderD151
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD144
/dev/dri/renderD145
/dev/dri/renderD146
/dev/dri/renderD147
/dev/dri/renderD148
/dev/dri/renderD149
/dev/dri/renderD150
/dev/dri/renderD151
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD144
/dev/dri/renderD145
/dev/dri/renderD146
/dev/dri/renderD147
/dev/dri/renderD148
/dev/dri/renderD149
/dev/dri/renderD150
/dev/dri/renderD151
/dev/dri/renderD140
/dev/dri/renderD141
)

KBOX_VA_GPU_MAP=(
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD130
/dev/dri/renderD131
/dev/dri/renderD132
/dev/dri/renderD133
/dev/dri/renderD134
/dev/dri/renderD135
/dev/dri/renderD128
/dev/dri/renderD129
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
/dev/dri/renderD138
/dev/dri/renderD139
/dev/dri/renderD140
/dev/dri/renderD141
/dev/dri/renderD142
/dev/dri/renderD143
/dev/dri/renderD136
/dev/dri/renderD137
)
KBOX_MOUNT_MAP=(
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
/home/mount
)
KBOX_CPUSET_MAP=(
"4 5"
"4 5"
"6 7"
"6 7"
"8 9"
"8 9"
"10 11"
"10 11"
"12 13"
"12 13"
"14 15"
"14 15"
"16 17"
"16 17"
"18 19"
"18 19"
"20 21"
"20 21"
"22 23"
"22 23"
"24 25"
"24 25"
"26 27"
"26 27"
"36 37"
"36 37"
"38 39"
"38 39"
"40 41"
"40 41"
"42 43"
"42 43"
"44 45"
"44 45"
"46 47"
"46 47"
"48 49"
"48 49"
"50 51"
"50 51"
"52 53"
"52 53"
"54 55"
"54 55"
"56 57"
"56 57"
"58 59"
"58 59"
"60 61"
"60 61"
"68 69"
"68 69"
"70 71"
"70 71"
"72 73"
"72 73"
"74 75"
"74 75"
"76 77"
"76 77"
"78 79"
"78 79"
"80 81"
"80 81"
"82 83"
"82 83"
"84 85"
"84 85"
"86 87"
"86 87"
"88 89"
"88 89"
"90 91"
"90 91"
"100 101"
"100 101"
"102 103"
"102 103"
"104 105"
"104 105"
"106 107"
"106 107"
"108 109"
"108 109"
"110 111"
"110 111"
"112 113"
"112 113"
"114 115"
"114 115"
"116 117"
"116 117"
"118 119"
"118 119"
"120 121"
"120 121"
"122 123"
"122 123"
"124 125"
"124 125"
)
